{% extends "base1.html" %}
{% block middle %}
    <style>
     /*分页*/
.pagination{
 margin-bottom: 20px;
}
.pagination .pagination-item{
  border: solid 1px #d6d6d6;
  border-radius: 0.2rem;
  color: #7d7d7d;
  text-decoration: none;
  text-transform: uppercase;
  display: inline-block;
  text-align: center;
  padding: 5px 9px;
 cursor: pointer;
}
     .nlist pre{
         font-size: 14px;
         color: #4c4b4b;
     }
    .more-link{
        font-size: 14px;
    }

     </style>
    <div class="content-body">
        <div class="container">
            <div class="row">
                <main class="col-md-8">

                    {% for info in data %}
                        <article class="post post-1">
                            <header class="entry-header">
                                <h1 class="entry-title">
                                    <a href="/detail/{{ info.hid }}/">{{info.title }}</a>
                                </h1>
                                <div class="entry-meta">
                                    <span class="post-category"><a

                                            href="#">{{ info.category_names }}</a
                                            ></span>

                                    <span class="post-date"><a href="#"><time class="entry-date"
                                                                              datetime="2012-11-09T23:15:57+00:00">{{info.edit_time}}</time></a></span>
                                    <span class="post-author"><a href="/detail/{{ info.hid }}/">{{info.edit_user_name }}</a></span>
                                    <span class="comments-link"><a
                                            href="/detail/{{ info.hid }}/">{{ info.like_count }} 点赞</a></span>
                                    <span class="views-count"><a
                                            href="/detail/{{ info.hid }}/">{{ info.count }} 阅读</a></span>
                                </div>
                            </header>
                            <div class="entry-content clearfix">
{#                                 <p>{{ info.detail | truncatechars:"100" | safe }}</p>#}
{#                                <p>{{ info.detail|safe|slice:":6"}}...</p>#}
{#                                <p>{{ info.detail|safe|truncatechars:10}}</p>#}

                                <div class="read-more cl-effect-14">
                                    <a href="/detail/{{ info.hid }}/" class="more-link">继续阅读 <span
                                            class="meta-nav">→</span></a>
                                </div>
                            </div>
                        </article>

                {% endfor %}

                    <!-- 简单分页效果
                    <div class="pagination-simple">
                        <a href="#">上一页</a>
                        <span class="current">第 6 页 / 共 11 页</span>
                        <a href="#">下一页</a>
                    </div>
                    -->
                <div class="container" style="text-align: center;">
                 <div class="col-md-6 col-md-offset-3">
                {% for contact in contacts %}
            {#     Each "contact" is a Contact model object.#}
                {{ contact.full_name|upper }}
            {% endfor %}
            <p class="pagination">

                <span class="step-links">
                    {% if contacts.has_previous %}
                        <a href="?page={{ contacts.previous_page_number }}">
                            <span class="pagination-item"> < </span>
                        </a>
                    {% endif %}
                    <span class="pagination-item">
                        <a href="?page={{ contacts.number }}">{{ contacts.number }}</a>
                    </span>
                    <span>...</span>
                    <span class="pagination-item">
                         <a href="?page={{ contacts.paginator.num_pages }}">{{ contacts.paginator.num_pages }}</a>
                    </span>

            {#            <font color="#9127c0">{{ contacts.number }}</font>  .... <font color="#9127c0">{{ contacts.paginator.num_pages }}</font>#}
                    </span>
                    {% if contacts.has_next %}
                        <a href="?page={{ contacts.next_page_number }}">
                            <span class="pagination-item"> > </span>
                        </a>
                    {% endif %}
                </span>
            </p>
            </div>
            </div>

                </main>

                <aside class="col-md-4">
                    <div class="widget widget-recent-posts">
                        <h3 class="widget-title">排行</h3>
                        <ul>
                            {% for i in count_title %}
                                <li>
                                    <a href="/detail/{{ i.hid }}/">{{ i.title }}</a>
                                </li>
                            {% endfor %}
                        </ul>

                    </div>
                    <div class="widget widget-archives">
                        <h3 class="widget-title">最新文章</h3>
                        <ul>
                            {% for info in new_title %}
                                <li>
                                    <a href="/detail/{{ info.hid }}/">{{ info.title }}</a>
                                </li>
                            {% endfor %}
                        </ul>
                    </div>

                    <div class="widget widget-category">
                        <h3 class="widget-title">分类</h3>
                        <ul>
                            {% for title in cate_name %}
                                <li>
                                    <a href="/cate_list/{{ title.category_id }}/">{{ title.category_name }}<span
                                            class="post-count"></span></a>
                                </li>
                            {% empty %}
                                暂无分类！
                            {% endfor %}
                        </ul>
                    </div>
                <div class="widget widget-archives">
                        <h3 class="widget-title">归档</h3>
                        <ul>
                            {% for time in time_list %}
                                <li>
                                    <a href="/time_{{ time.0 }}/?page=1">{{ time.0 }}</a>
                                </li>
                            {% endfor %}
                        </ul>
                    </div>

                    <div class="widget widget-tag-cloud">
                        <h3 class="widget-title">搜索</h3>
                        <ul>
                            <form action="/post/" method="POST">
                         <span><font>ip:</font></span>
                          <input type="text" name="ip">
                          <input type="submit" value="ip归属地">
                      </form>
                        <form action="/cat_title/" method="POST">
                         <span><font>问题:</font></span>
                          <input type="text" name="title">
                          <input type="submit" value="提交">
                      </form>

                        </ul>
                    </div>
                <div class="widget widget-archives">
                        <h3 class="widget-title">友情链接</h3>
                        <ul>

                                <li>
                                    <a href="https://gitee.com/zhaohengping">&copy; 码云</a>

                                </li>
                            <li>
                                <a href="https://blog.csdn.net/zhplz123">&copy; CSDN</a>
                            </li>

                        </ul>
                    </div>

                </aside>
            </div>
        </div>
    </div>
{% endblock %}
